#include <iostream>
#include <thread>
using namespace std;
void fun(int n,const string &name){
        for(int i=0;i<n;i++){
            cout<<name<<endl;
            cout<<"任务完成"<<endl;
        }
    }
int main()
{  
    thread t1(fun,3,"zhangsan");
    cout<<"任务开始"<<endl;
    for(int i=0;i<10;i++){
        cout<<"任务"<<i+1<<"开始"<<endl;
        cout<<"任务"<<i+1<<"执行中..."<<endl;
        cout<<"任务"<<i+1<<"完成"<<endl;
        cout<<endl;
    }
    cout<<"全部任务完成"<<endl;
    t1.join();
    return 0;
}